#! /bin/sh
patch -p1 -f $* < $0
exit $?

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: xantares <xantares09@hotmail.com>
Date: Mon, 28 Sep 2015 08:21:42 +0000
Subject: [PATCH] Fix {make,jump}_fcontext visibility with mingw

taken from: https://github.com/boostorg/context/pull/22

diff --git a/libs/context/src/asm/jump_i386_ms_pe_gas.asm b/src/asm/jump_i386_ms_pe_gas.asm
index 1111111..2222222 100644
--- a/libs/context/src/asm/jump_i386_ms_pe_gas.asm
+++ b/libs/context/src/asm/jump_i386_ms_pe_gas.asm
@@ -138,3 +138,6 @@ _jump_fcontext:

     /* indirect jump to context */
     jmp  *%edx
+
+.section .drectve
+.ascii " -export:\"jump_fcontext\""
diff --git a/libs/context/src/asm/jump_x86_64_ms_pe_gas.asm b/src/asm/jump_x86_64_ms_pe_gas.asm
index 1111111..2222222 100644
--- a/libs/context/src/asm/jump_x86_64_ms_pe_gas.asm
+++ b/libs/context/src/asm/jump_x86_64_ms_pe_gas.asm
@@ -223,3 +223,6 @@ jump_fcontext:
     /* indirect jump to context */
     jmp  *%r10
 .seh_endproc
+
+.section .drectve
+.ascii " -export:\"jump_fcontext\""
diff --git a/libs/context/src/asm/make_i386_ms_pe_gas.asm b/src/asm/make_i386_ms_pe_gas.asm
index 1111111..2222222 100644
--- a/libs/context/src/asm/make_i386_ms_pe_gas.asm
+++ b/libs/context/src/asm/make_i386_ms_pe_gas.asm
@@ -122,3 +122,6 @@ finish:
     hlt

 .def	__exit;	.scl	2;	.type	32;	.endef  /* standard C library function */
+
+.section .drectve
+.ascii " -export:\"make_fcontext\""
diff --git a/libs/context/src/asm/make_x86_64_ms_pe_gas.asm b/src/asm/make_x86_64_ms_pe_gas.asm
index 1111111..2222222 100644
--- a/libs/context/src/asm/make_x86_64_ms_pe_gas.asm
+++ b/libs/context/src/asm/make_x86_64_ms_pe_gas.asm
@@ -149,3 +149,6 @@ finish:
 .seh_endproc

 .def	_exit;	.scl	2;	.type	32;	.endef  /* standard C library function */
+
+.section .drectve
+.ascii " -export:\"make_fcontext\""
